-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[VectorCombine] Shrink loads used in shufflevector rebroadcasts. #153138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Attempt to shrink the size of vector loads where only some of the incoming lanes are used for rebroadcasts in shufflevector instructions.
✅ With the latest revision this PR passed the undef deprecator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - cheers
This triggers failed asserts when compiling for ARM: short *ScaleUVRowDown2_C_src, *ScaleUVRowDown2_C_dst;
int ScaleUVRowDown2_C_x;
void ScaleUVRowDown2_C() {
for (; ScaleUVRowDown2_C_x; ScaleUVRowDown2_C_x += 2) {
ScaleUVRowDown2_C_dst[0] = ScaleUVRowDown2_C_src[1];
ScaleUVRowDown2_C_dst[1] = ScaleUVRowDown2_C_src[3];
ScaleUVRowDown2_C_src += 2;
ScaleUVRowDown2_C_dst += 2;
}
} $ clang -target armv7-linux-gnueabihf -c repro.c -O2
clang: ../include/llvm/ADT/ArrayRef.h:253: const T& llvm::ArrayRef<T>::operator[](size_t) const [with T = int; size_t = long unsigned int]: Assertion `Index < Length && "Invalid index!"' failed. |
Also, note the commit https://github.com/llvm/llvm-project/commit/9115bef8ee1d9a47fef3221d9f3e0fd5c4ed947c.patch ended up with a hidden email. Please turn off Keep my email addresses private setting in your account. See LLVM Developer Policy and LLVM Discourse for more information. |
This seems to be a bug in the ARM backend. The generated shufflevector is valid (see below), but the function
|
Even if this is an unrelated backend bug, I'd like to revert this change, that exposes the preexisting issue, in order to get back to green until we have the backend bug fixed. |
I'll take a look. |
…ts. (llvm#153138)" This reverts commit 9115bef.
Fixes the issue reported on llvm#153138, where odd-sized vectors would cause the checks to iterate off the end of the mask.
Reopen #128938.
Attempt to shrink the size of vector loads where only some of the incoming lanes are used for rebroadcasts in shufflevector instructions.